package logic

import (
	"activity_srv/internal/dao"
	"context"
	"errors"

	"activity_srv/activity"
	"activity_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type DeleteGrouponProductLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewDeleteGrouponProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteGrouponProductLogic {
	return &DeleteGrouponProductLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *DeleteGrouponProductLogic) DeleteGrouponProduct(in *activity.DeleteGrouponProductRequest) (*activity.DeleteGrouponProductResponse, error) {
	// todo: add your logic here and delete this line
	_, err := dao.DeleteGrouponProduct(in)
	if err != nil {
		return nil, errors.New("删除拼团商品信息失败")
	}
	return &activity.DeleteGrouponProductResponse{}, nil
}
